// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取角色列表 */
export async function getRoleList(params: API.PageParams, options?: { [key: string]: any }) {
  return request<API.RuleList>('/system/auth_group/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 新增角色 */
export async function addItem(data: {}, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/system/auth_group/add', {
    data,
    method: 'post',
    ...(options || {}),
  });
}

/** 编辑角色 */
export async function updateItem(data: {}, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/system/auth_group/edit', {
    data,
    method: 'post',
    ...(options || {}),
  });
}

/** 删除角色 */
export async function removeItem(data: {}, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/system/auth_group/delete', {
    data,
    method: 'post',
    ...(options || {}),
  });
}
